package com.question.controller.user;

import com.question.pojo.result.Result;
import com.question.pojo.vo.UserSortVO;
import com.question.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/users/sort")
@Slf4j
@Api(tags = "用户排行接口")
public class UserSortController {

    @Autowired
    private UserService userService;

    /**
     * 获取用户排行信息
     * @return
     */
    @GetMapping
    @ApiOperation("获取用户排行信息")
    public Result<UserSortVO> getPersonalSort(){
        log.info("获取用户排行信息");
        UserSortVO userSortVO = userService.getSortAll();
        return Result.success(userSortVO);
    }
}
